|
|
Joined: Mar 2006
Posts: 32
Beta Tester
|
|
Beta Tester
Joined: Mar 2006
Posts: 32 |
This is a small mod to add to your forum stats on how many posts were made in 24 hours. In cache builders ->forum_stats.php Add: // Get last Total Posts for Last 24hrs // get the current timestamp into an array $timestamp = time(); // echo strftime('%Hh%M %A %d %b',$timestamp); // echo '<p>'; $date_time_array = getdate($timestamp);
$hours = $date_time_array['hours']; $minutes = $date_time_array['minutes']; $seconds = $date_time_array['seconds']; $month = $date_time_array['mon']; $day = $date_time_array['mday']; $year = $date_time_array['year'];
// use mktime to recreate the unix timestamp // adding 19 hours to $hours $timestamp = mktime($hours - 29,$minutes,$seconds,$month,$day,$year); // echo strftime('%Hh%M %A %d %b',$timestamp); // echo '<br>~E after subtracting 29 hours';
$query = " select count(*) from {$config['TABLE_PREFIX']}POSTS WHERE POST_POSTED_TIME > $timestamp "; $sth = $dbh->do_query($query); list($new_posts) = $dbh->fetch_array($sth);
Under: $query = " select count(USER_ID) from {$config['TABLE_PREFIX']}USERS where USER_IS_APPROVED = 'yes' and USER_ID > 1 "; $sth = $dbh->do_query($query); list($users) = $dbh->fetch_array($sth);
In langauges->island_forum_stats.php Add: $ubbt_lang['NEW_POSTS'] = "Posts in 24rs";
Under: $ubbt_lang['USERS'] = "Members";
In templates->island_forum_stats.tpl Add: <b>{$new_posts}</b> {$lang.NEW_POSTS}
Above: <b>{$users}</b> {$lang.USERS}
Quoting Ian from a post at ubbthreads In langauges->island_forum_stats.php
is langauges->portal_islands.php
in 7.1 beta (when you get it)
Screen shot of what it adds ![[Linked Image]](http://www.gliderdad79.com/images/stats.jpg)
|
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
// Get last Total Posts for Last 24hrs // get the current timestamp into an array $timestamp = time(); // echo strftime('%Hh%M %A %d %b',$timestamp); // echo '<p>'; $date_time_array = getdate($timestamp);
$hours = $date_time_array['hours']; $minutes = $date_time_array['minutes']; $seconds = $date_time_array['seconds']; $month = $date_time_array['mon']; $day = $date_time_array['mday']; $year = $date_time_array['year'];
// use mktime to recreate the unix timestamp // adding 19 hours to $hours $timestamp = mktime($hours - 29,$minutes,$seconds,$month,$day,$year); // echo strftime('%Hh%M %A %d %b',$timestamp); // echo '<br>~E after subtracting 29 hours'; could be simplied to $timestamp = time() - 86400;
|
|
|
|
|
Joined: Jan 2000
Posts: 5,834 Likes: 20
UBBDev Owner Time Lord
|
|
UBBDev Owner Time Lord
Joined: Jan 2000
Posts: 5,834 Likes: 20 |
I posted something similar (well about being able to do this) at ubbcentral 
|
|
|
|
|
Joined: Mar 2006
Posts: 32
Beta Tester
|
|
Beta Tester
Joined: Mar 2006
Posts: 32 |
Scratch this, not gona work for 7.1
|
|
|
|
|
Joined: Jan 2000
Posts: 5,834 Likes: 20
UBBDev Owner Time Lord
|
|
UBBDev Owner Time Lord
Joined: Jan 2000
Posts: 5,834 Likes: 20 |
A 7.1 version can be found here
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 253
Joined: January 2000
|
|
|
Forums63
Topics37,583
Posts293,955
Members13,824
| |
Most Online151,614 Nov 14th, 2025
|
|
Currently Online 435
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 18
|
|
|
|